# Contributor: André Klitzing <aklitzing@@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=croc
pkgver=9.6.0
pkgrel=0
pkgdesc="Easily and securely send things from one computer to another"
url="https://github.com/schollz/croc"
license="MIT"
arch="all"
makedepends="go"
source="https://github.com/schollz/croc/releases/download/v$pkgver/croc_${pkgver}_src.tar.gz"

# secfixes:
#   9.1.0-r0:
#     - CVE-2021-31603

build() {
	export CGO_LDFLAGS="$LDFLAGS"
	export GOFLAGS="$GOFLAGS -trimpath -mod=vendor"
	go mod vendor
	go build
}

check() {
	go test ./...
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin croc
}

sha512sums="
df0ebb71ac1e897864b5a01531a4d9fd20e1f56eb4fb11f8aed25456d6571acf5703d6415669446d239add59ec5510751358768b0ef890b6fded2ac03160d84b  croc_9.6.0_src.tar.gz
"
